package com.Action;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ServletActionContext;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by Administrator on 2017/3/18.
 * 这是退出登录的动作
 */
public class ExitAction extends ActionSupport {
    @Override
    public String execute() throws Exception {
        HttpServletRequest request= ServletActionContext.getRequest();
        request.setCharacterEncoding("utf-8");
        if(request.getSession().getAttribute("Account")!=null)
        request.getSession().removeAttribute("Account");
        if(request.getSession().getAttribute("privilege")!=null)
            request.getSession().removeAttribute("privilege");
        return super.execute();
    }
}
